package com.tz.farmer.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tz.farmer.model.TradeInfo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

public interface TradeInfoMapper extends BaseMapper<TradeInfo> {


    @Select("select t.* from trade_info t ,product_info p  where p.id = t.p_info_id and p.p_name=#{goodsName} and trade_time = DATE_FORMAT( FROM_UNIXTIME(#{tradeTime}/ 1000, '%Y-%m-%d %h:%i:%s' ), '%Y-%m-%d' ) order by trade_time desc limit 1 ")
    TradeInfo selectTradeInfo(@Param("goodsName") String goodsName,@Param("tradeTime") String tradeTime);
}
